﻿using CardPlay.Model.CardModel;
using CardPlay.Model.GameModel;
using CardPlay.Model.GameModel.Actions;

namespace CardPlay.DemoPack.Games.CongressVariants
{
    [Game("B8D05259-91BE-41C6-83FE-395BB6A4D723", LevelOfDifficulty.Medium, LevelOfSkill.ModerateSkill, DurationOfPlay.MoreThan10Minutes, NumberOfDecks = 2, Family = FamilyName)]
    public class Diplomat : Congress
    {
        public Diplomat()
        {
            TableauBuildSequence = CardFaceSequence.AnySuitDescendingRank;
        }

        protected override void PrepareDealScript(DealScript script)
        {
            foreach (var name in NamesOfTableaus)
                script.Deal("4 up").To(name);

            script.DealRemainingFaceDownTo(Stock);
        }

        protected override bool AllowedToBuildEmptyTableau(MovePileAction action)
        {
            return action.PileBeingMoved.BottomCard.Rank != FoundationBaseRank;
        }

        protected override void OnTransactionEnding()
        {
        }
    }
}